package com.springboot.study;

import com.alibaba.fastjson.JSONObject;
import com.springboot.study.config.CarProperties;
import com.springboot.study.entity.UserEntity;
import com.springboot.study.service.HelloService;
import com.springboot.study.service.SpringUtil;
import com.springboot.study.service.impl.HelloServiceImpl2;
import com.springboot.study.utils.StringUtils;
import com.study.service.studyservice.annotation.EnableSpringStudy;
import com.study.service.studyservice.bean.StudentBean;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ImportResource;
import org.springframework.retry.annotation.EnableRetry;
import org.springframework.scheduling.annotation.EnableAsync;

@EnableAsync
@SpringBootApplication
@EnableRetry
@EnableAspectJAutoProxy
@EnableSpringStudy
@ImportResource(locations = {"classpath:beans.xml", "classpath:beans1.xml"})
@MapperScan("com.springboot.study.mapper")
public class SpringbootStudyApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootStudyApplication.class, args);


//        String[] strings = context.getBeanNamesForType(UserEntity.class);
//        for(String s : strings){
//            System.out.println(s);
//        }
//
//        HelloService helloService = (HelloService)SpringUtil.getBean(HelloServiceImpl2.class);
//        helloService.sayHello();
//
//
//        CarProperties carProperties = context.getBean(CarProperties.class);
//        System.out.println(carProperties);


        StudentBean studentBean = context.getBean(StudentBean.class);

        System.out.println("-------------------------####"+JSONObject.toJSONString(studentBean));

    }

}
